﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TDSDedctorMaster.aspx.cs" Inherits="Main_Accounts_TDSDedctorMaster" Culture="en-GB" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControl" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>TDS DeductorMaster</title>
    <link href="../../Styles/accounts.css" rel="stylesheet" type="text/css" />
    <script src="../../JavaScript/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    function isNumberKey(control_id, evt)
        {
            var charCode = (evt.which) ? evt.which : event.keyCode
            if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode < 45 || charCode > 47))
            return false;

            if (charCode == 46)
            {
            var dotcount = document.getElementById(control_id).value.split('.').length - 1;
            if (dotcount >= 1)
            {
            return false;
            }
            }
            return true;
        }
        function RequiredValidator() {
            var flag = true;
            if (document.getElementById("txtDeuctorName").value == '') {
                alert('Specify Deductor Name');
                document.getElementById("txtDeuctorName").focus();
                flag = false;
            }
            else if (document.getElementById("txtDeuctorFlat").value == '') {
                alert('Specify Deductor\'s Flat/Door/Block No.');
                document.getElementById("txtDeuctorFlat").focus();
                flag = false;
            }
            else if (document.getElementById("txtDeuctorCity").value == '') {
                alert('Specify Deductor\'s City');
                document.getElementById("txtDeuctorCity").focus();
                flag = false;
            }
            else if (document.getElementById("txtDeuctorPincode").value == '') {
                alert('Specify Deductor\'s Pincode');
                document.getElementById("txtDeuctorPincode").focus();
                flag = false;
            }
            else if (document.getElementById("ddlDeductorState").selectedIndex == 0) {
                alert('Specify Deductor\'s State');
                document.getElementById("ddlDeductorState").focus();
                flag = false;
            }
            else if (document.getElementById("txtDeuctorTAN").value == '') {
                alert('Specify Deductor\'s TAN Number ');
                document.getElementById("txtDeuctorTAN").focus();
                flag = false;
            }
            else if (document.getElementById("txtPersonName").value == '') {
                alert('Specify Responsible Person\'s Name');
                document.getElementById("txtPersonName").focus();
                flag = false;
            }
            else if (document.getElementById("txtPersonDesignation").value == '') {
                alert('Specify Responsible Person\'s Designation');
                document.getElementById("txtPersonDesignation").focus();
                flag = false;
            }
            else if (document.getElementById("txtPersonFlat").value == '') {
                alert('Specify Responsible Person\'s Flat/Door/Block No.');
                document.getElementById("txtPersonFlat").focus();
                flag = false;
            }
            else if (document.getElementById("txtPersonPincode").value == '') {
                alert('Specify Responsible Person\'s Pincode');
                document.getElementById("txtPersonPincode").focus();
                flag = false;
            }
            else if (document.getElementById("ddlPersonState").selectedIndex == 0) {
                alert('Specify Responsible Person\'s State');
                document.getElementById("ddlPersonState").focus();
                flag = false;
            }
            return flag;
        }
        function ValidateInput() {
            var flag = true;
            if (document.getElementById("txtDeuctorPincode").value != '') {
                var PinCode = document.getElementById("txtDeuctorPincode").value;
                if (PinCode.length != 6) {
                    alert('Invalid Deductor\'s Pincode');
                    document.getElementById("txtDeuctorPincode").focus();
                    flag = false;
                }
            }
            else if (document.getElementById("txtPersonPincode").value != '') {
                var PinCode = document.getElementById("txtPersonPincode").value;
                if (PinCode.length != 6) {
                    alert('Invalid Responsible Person\'s Pincode');
                    document.getElementById("txtPersonPincode").focus();
                    flag = false;
                }
            }
            else if (document.getElementById("txtDeuctorPAN").value != '') {
                var PanNumber = '';
                PanNumber = document.getElementById("txtDeuctorPAN").value;
                if (PanNumber.length != 10) {
                    alert('Invalid Deductor\'s PAN Number');
                    document.getElementById("txtDeuctorPAN").focus();
                    flag = false;
                }
            }
            return flag;
        }
        function Validation() {
            if (RequiredValidator() && ValidateInput()) {
                return true;
            }
            else {
                return false;
            }
        }
        </script>
<style type="text/css">   
#wrapper {
    width:80%;
    margin-left:5%;
    margin-top:15px;
}
ul.tabs {
    width:99%;
    margin:0;
    padding:0;
}
ul.tabs li {
    display:block;
    float:left;
    padding:0 5px;
}
ul.tabs li a {
    display:block;
    float:left;
    padding:5px;
    font-size:0.8em;
    background-color:#e0e0e0;
    color:#666;
    text-decoration:none;
}
.selected {
    font-weight:bold;
}
.tab-content {
	clear:both;
    border:1px solid #ddd;
    padding:10px;    
}
</style>
<script type="text/javascript">
    $(document).ready(function() {

        $('.tabs a').click(function() {
            switch_tabs($(this));
        });

        switch_tabs($('.defaulttab'));

    });

    function switch_tabs(obj) {
        $('.tab-content').hide();
        $('.tabs a').removeClass("selected");
        var id = obj.attr("rel");

        $('#' + id).show();
        obj.addClass("selected");
    }

</script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="divmain">
        <acc:heading ID="header1" runat="server" HeadingText="TDS Master" />               
    </div>
    <div style="width:80%; margin-left:5%; text-align:center;">
        <asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label>
    </div>
    <div id="wrapper">    
        <ul class="tabs">
            <li><a href="javascript:void(0)" class="defaulttab" rel="tabDeducter">Deductor Details</a></li>
            <li><a href="javascript:void(0)"  rel="tabResponsiblePerson"> Responsible Person Details</a></li>           
        </ul>                  
        <div class="tab-content" id="tabDeducter" runat="server" style="width:100%">
             <table width="100%" cellpadding="2" cellspacing="0">
                <tr>
                    <td>
                        Name:<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorName" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Branch/Division
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorBranch" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Flat/Door/Block No.<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorFlat" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Name of Building
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorBuilding" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Street/Road Name
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorStreet" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Area
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorArea" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        City<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorCity" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Pincode<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorPincode" runat="server" MaxLength="6" onkeypress="return isNumberKey(this.id,event);" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        State<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:DropDownList ID="ddlDeductorState" runat="server" Width="148px" CssClass="dropdown"></asp:DropDownList>
                    </td>
                    <td>
                        Address Change<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:DropDownList ID="ddlDeductorChangeAddress" runat="server" CssClass="dropdown">
                            <asp:ListItem Text="No" Value="0"></asp:ListItem>
                            <asp:ListItem Text="Yes" Value="1"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        STD Code
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorSTDCode" runat="server" MaxLength="4" onkeypress="return isNumberKey(this.id,event);" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        E-Mail
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorEmail" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Telephone
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorTelephone" onkeypress="return isNumberKey(this.id,event);" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Fax
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorFax" onkeypress="return isNumberKey(this.id,event);" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">                    
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="4" style="border-top:solid 1px #818181">                    
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        PAN
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorPAN" runat="server" MaxLength="10" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Exist TDS Assessee<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:DropDownList ID="ddlDeductorAssessee" runat="server" CssClass="dropdown">
                            <asp:ListItem Text="No" Value="0"></asp:ListItem>
                            <asp:ListItem Text="Yes" Value="1"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        TAN<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:TextBox ID="txtDeuctorTAN" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Status<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:DropDownList ID="ddlDeductorStatus" runat="server" CssClass="dropdown">                           
                            <asp:ListItem Text="Government" Value="0"></asp:ListItem>
                            <asp:ListItem Text="Others" Value="1" Selected="True"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        Deducter Type:<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:DropDownList ID="ddlDeductorType" runat="server" Width="148px" CssClass="dropdown">
                            <asp:ListItem Text="Company" Value="0"></asp:ListItem>
                            <asp:ListItem Text="Branch/Division of Company" Value="1"></asp:ListItem>
                            <asp:ListItem Text="Association of Person (AOP)" Value="2"></asp:ListItem>
                            <asp:ListItem Text="Association of Person (Trust)" Value="3"></asp:ListItem>
                            <asp:ListItem Text="Artificail Juridical Person" Value="4"></asp:ListItem>
                            <asp:ListItem Text="Body of Individuals" Value="5"></asp:ListItem>
                            <asp:ListItem Text="Individauls/HUF" Value="6"></asp:ListItem>                            
                        </asp:DropDownList>
                    </td>                   
                </tr>
            </table>
        </div>
        <div class="tab-content" id="tabResponsiblePerson" runat="server" style="width:100%">
             <table width="100%" cellpadding="2" cellspacing="0">
                <tr>
                    <td>
                        Name:<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonName" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Designation<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonDesignation" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Gender
                    </td>
                     <td>
                        <asp:RadioButtonList ID="rbtPersonGender" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Text="Male" Value="0" Selected="True"></asp:ListItem>
                            <asp:ListItem Text="Female" Value="1"></asp:ListItem>
                        </asp:RadioButtonList> 
                    </td>
                    <td>
                        Father's Name
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonFatherName" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Flat/Door/Block No.<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonFlat" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Name of Building
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonBuilding" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Street/Road Name
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonStreet" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Area
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonArea" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        City
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonCity" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Pincode<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonPincode" runat="server" onkeypress="return isNumberKey(this.id,event);" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        State<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:DropDownList ID="ddlPersonState" runat="server" Width="148px" CssClass="dropdown"></asp:DropDownList>
                    </td>
                    <td>
                        Address Change<span style="color:Red;">*</span>
                    </td>
                     <td>
                        <asp:DropDownList ID="ddlPersonChangeAddress" runat="server" CssClass="dropdown">
                            <asp:ListItem Text="No" Value="0"></asp:ListItem>
                            <asp:ListItem Text="Yes" Value="1"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        STD Code
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonSTDCode" runat="server" onkeypress="return isNumberKey(this.id,event);" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        E-Mail
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonEmail" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Telephone
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonTelephone" onkeypress="return isNumberKey(this.id,event);" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                    <td>
                        Fax
                    </td>
                     <td>
                        <asp:TextBox ID="txtPersonFax" onkeypress="return isNumberKey(this.id,event);" runat="server" CssClass="input"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div style="width:80%; margin-left:5%; text-align:center;">
        <asp:Button ID="btnSave" runat="server" OnClientClick="return Validation();" OnClick="btnSave_OnClick" CssClass="button" Text="Save" />&nbsp;
        <asp:Button ID="btnCancel" runat="server" OnClick="btnCancel_OnClick" CssClass="button" Text="Cancel" />
    </div>
    </form>
</body>
</html>
